package com.example.springboot09tesk.controller;

import com.example.springboot09tesk.service.AsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 */
@RestController
public class AsyncController {
    @Autowired
    AsyncService asyncService;

    @RequestMapping("/hello")
    public String hello(){
        asyncService.hello();
        //没有AsyncService.java和Application类中的Async注解, 则会停止3s之后才会返回ok。
        return "ok";
    }
}
